<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>oauth2client.appengine</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="oauth2client-module.html">Package&nbsp;oauth2client</a> ::
        Module&nbsp;appengine
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="oauth2client.appengine-module.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== MODULE DESCRIPTION ==================== -->
<h1 class="epydoc">Module appengine</h1><p class="nomargin-top"><span class="codelink"><a href="oauth2client.appengine-pysrc.html">source&nbsp;code</a></span></p>
<pre class="literalblock">
Utilities for Google App Engine

Utilities for making it easier to use OAuth 2.0 on Google App Engine.

</pre>

<hr />
<div class="fields">      <p><strong>Author:</strong>
        jcgregorio@google.com (Joe Gregorio)
      </p>
</div><!-- ==================== CLASSES ==================== -->
<a name="section-Classes"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Classes</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Classes"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="oauth2client.appengine.InvalidClientSecretsError-class.html" class="summary-name">InvalidClientSecretsError</a><br />
      The client_secrets.json file is malformed or missing required fields.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="oauth2client.appengine.InvalidXsrfTokenError-class.html" class="summary-name">InvalidXsrfTokenError</a><br />
      The XSRF token is invalid or expired.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="oauth2client.appengine.SiteXsrfSecretKey-class.html" class="summary-name">SiteXsrfSecretKey</a><br />
      Storage for the sites XSRF secret key.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="oauth2client.appengine.SiteXsrfSecretKeyNDB-class.html" class="summary-name">SiteXsrfSecretKeyNDB</a><br />
      NDB Model for storage for the sites XSRF secret key.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="oauth2client.appengine.AppAssertionCredentials-class.html" class="summary-name">AppAssertionCredentials</a><br />
      Credentials object for App Engine Assertion Grants
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="oauth2client.appengine.FlowProperty-class.html" class="summary-name">FlowProperty</a><br />
      App Engine datastore Property for Flow.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="oauth2client.appengine.FlowNDBProperty-class.html" class="summary-name">FlowNDBProperty</a><br />
      App Engine NDB datastore Property for Flow.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="oauth2client.appengine.CredentialsProperty-class.html" class="summary-name">CredentialsProperty</a><br />
      App Engine datastore Property for Credentials.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="oauth2client.appengine.CredentialsNDBProperty-class.html" class="summary-name">CredentialsNDBProperty</a><br />
      App Engine NDB datastore Property for Credentials.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="oauth2client.appengine.StorageByKeyName-class.html" class="summary-name">StorageByKeyName</a><br />
      Store and retrieve a credential to and from the App Engine datastore.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="oauth2client.appengine.CredentialsModel-class.html" class="summary-name">CredentialsModel</a><br />
      Storage for OAuth 2.0 Credentials
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="oauth2client.appengine.CredentialsNDBModel-class.html" class="summary-name">CredentialsNDBModel</a><br />
      NDB Model for storage of OAuth 2.0 Credentials
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="oauth2client.appengine.OAuth2Decorator-class.html" class="summary-name">OAuth2Decorator</a><br />
      Utility for making OAuth 2.0 easier.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="oauth2client.appengine.OAuth2DecoratorFromClientSecrets-class.html" class="summary-name">OAuth2DecoratorFromClientSecrets</a><br />
      An OAuth2Decorator that builds from a clientsecrets file.
    </td>
  </tr>
</table>
<!-- ==================== FUNCTIONS ==================== -->
<a name="section-Functions"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Functions</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Functions"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="oauth2client.appengine-module.html#_safe_html" class="summary-sig-name" onclick="show_private();">_safe_html</a>(<span class="summary-sig-arg">s</span>)</span><br />
      Escape text to make it safe to display.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="oauth2client.appengine-pysrc.html#_safe_html">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="_generate_new_xsrf_secret_key"></a><span class="summary-sig-name">_generate_new_xsrf_secret_key</span>()</span><br />
      Returns a random XSRF secret key.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="oauth2client.appengine-pysrc.html#_generate_new_xsrf_secret_key">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="oauth2client.appengine-module.html#xsrf_secret_key" class="summary-sig-name">xsrf_secret_key</a>()</span><br />
      Return the secret key for use for XSRF protection.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="oauth2client.appengine-pysrc.html#xsrf_secret_key">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="oauth2client.appengine-module.html#_build_state_value" class="summary-sig-name" onclick="show_private();">_build_state_value</a>(<span class="summary-sig-arg">request_handler</span>,
        <span class="summary-sig-arg">user</span>)</span><br />
      Composes the value for the 'state' parameter.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="oauth2client.appengine-pysrc.html#_build_state_value">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="oauth2client.appengine-module.html#_parse_state_value" class="summary-sig-name" onclick="show_private();">_parse_state_value</a>(<span class="summary-sig-arg">state</span>,
        <span class="summary-sig-arg">user</span>)</span><br />
      Parse the value of the 'state' parameter.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="oauth2client.appengine-pysrc.html#_parse_state_value">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="oauth2client.appengine-module.html#oauth2decorator_from_clientsecrets" class="summary-sig-name">oauth2decorator_from_clientsecrets</a>(<span class="summary-sig-arg">filename</span>,
        <span class="summary-sig-arg">scope</span>,
        <span class="summary-sig-arg">message</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">cache</span>=<span class="summary-sig-default">None</span>)</span><br />
      Creates an OAuth2Decorator populated from a clientsecrets file.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="oauth2client.appengine-pysrc.html#oauth2decorator_from_clientsecrets">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
</table>
<!-- ==================== VARIABLES ==================== -->
<a name="section-Variables"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Variables</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Variables"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="logger"></a><span class="summary-name">logger</span> = <code title="logging.getLogger(__name__)">logging.getLogger(__name__)</code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="OAUTH2CLIENT_NAMESPACE"></a><span class="summary-name">OAUTH2CLIENT_NAMESPACE</span> = <code title="'oauth2client#ns'">'oauth2client#ns'</code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="XSRF_MEMCACHE_ID"></a><span class="summary-name">XSRF_MEMCACHE_ID</span> = <code title="'xsrf_secret_key'">'xsrf_secret_key'</code>
    </td>
  </tr>
</table>
<!-- ==================== FUNCTION DETAILS ==================== -->
<a name="section-FunctionDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Function Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-FunctionDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="_safe_html"></a>
<div class="private">
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">_safe_html</span>(<span class="sig-arg">s</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="oauth2client.appengine-pysrc.html#_safe_html">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">
Escape text to make it safe to display.

Args:
  s: string, The text to escape.

Returns:
  The escaped text as a string.

</pre>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="xsrf_secret_key"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">xsrf_secret_key</span>()</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="oauth2client.appengine-pysrc.html#xsrf_secret_key">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">
Return the secret key for use for XSRF protection.

If the Site entity does not have a secret key, this method will also create
one and persist it.

Returns:
  The secret key.

</pre>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="_build_state_value"></a>
<div class="private">
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">_build_state_value</span>(<span class="sig-arg">request_handler</span>,
        <span class="sig-arg">user</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="oauth2client.appengine-pysrc.html#_build_state_value">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">
Composes the value for the 'state' parameter.

Packs the current request URI and an XSRF token into an opaque string that
can be passed to the authentication server via the 'state' parameter.

Args:
  request_handler: webapp.RequestHandler, The request.
  user: google.appengine.api.users.User, The current user.

Returns:
  The state value as a string.

</pre>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="_parse_state_value"></a>
<div class="private">
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">_parse_state_value</span>(<span class="sig-arg">state</span>,
        <span class="sig-arg">user</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="oauth2client.appengine-pysrc.html#_parse_state_value">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">
Parse the value of the 'state' parameter.

Parses the value and validates the XSRF token in the state parameter.

Args:
  state: string, The value of the state parameter.
  user: google.appengine.api.users.User, The current user.

Raises:
  InvalidXsrfTokenError: if the XSRF token is invalid.

Returns:
  The redirect URI.

</pre>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="oauth2decorator_from_clientsecrets"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">oauth2decorator_from_clientsecrets</span>(<span class="sig-arg">filename</span>,
        <span class="sig-arg">scope</span>,
        <span class="sig-arg">message</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">cache</span>=<span class="sig-default">None</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="oauth2client.appengine-pysrc.html#oauth2decorator_from_clientsecrets">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">
Creates an OAuth2Decorator populated from a clientsecrets file.

Args:
  filename: string, File name of client secrets.
  scope: string or list of strings, scope(s) of the credentials being
    requested.
  message: string, A friendly string to display to the user if the
    clientsecrets file is missing or invalid. The message may contain HTML and
    will be presented on the web interface for any method that uses the
    decorator.
  cache: An optional cache service client that implements get() and set()
    methods. See clientsecrets.loadfile() for details.

Returns: An OAuth2Decorator

</pre>
  <dl class="fields">
    <dt>Decorators:</dt>
    <dd><ul class="nomargin-top">
        <li><code>@util.positional(2)</code></li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Thu Jan 24 16:14:31 2013
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
